#!/usr/bin/env python
# -*- coding:utf-8 -*-

import requests

h = requests.head('https://www.baidu.com')
print("headers:\n", h.headers)
print('text:\n', h.text)

print('*' * 50)
data1 = {'key1': 'value1', 'key2': 'value2'}
po = requests.post('http://httpbin.org/post', data=data1)
# print(po.text)
po1 = requests.post('http://httpbin.org/post', data='ABC')
print(po1.text)
print('*' * 50)
pu = requests.put('http://httpbin.org/put', data=data1)
print(pu.text)
